<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>后台管理</title>
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/layui/css/layui.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/admin.css"/>
<style>
.layui-form-label{ width:200px;}
.layui-input-block{ margin-left:230px;}
</style>
</head>
<body>

<form class="layui-form info_form" method="post" action="{:url('save')}" style="width: 90%;padding-top: 20px;">
<div class="layui-tab page-content-wrap">

  <ul class="layui-tab-title">
    
    {volist name="vars.CONFIG_GROUP_LIST" id="group"}
    <li {if condition="$key eq 1"}class="layui-this"{/if}>{$group}</li>
    {/volist}

  </ul>
  
  
  <div class="layui-tab-content">
    
    
    {php}$gkey = 1;{/php}
    {volist name="vars.CONFIG_GROUP_LIST" id="group"}
    <div class="layui-tab-item {if condition="$gkey eq 1"}layui-show{/if}">
      
       {if condition="isset($list[$gkey])"}
       {volist name="list[$gkey]" id="config"}
        {switch name="config.type"}
        {case value="0"}
        <div class="layui-form-item">
          <label class="layui-form-label">{$config.title}：</label>
          <div class="layui-input-block">
            <input type="text" name="config[{$config.name}]" required  lay-verify="required" placeholder="{$config.title}" autocomplete="off" class="layui-input" value="{$config.value}">
          </div>
        </div>
        {/case}
        
        {case value="1"}
        <div class="layui-form-item">
          <label class="layui-form-label">{$config.title}：</label>
          <div class="layui-input-block">
            <input type="text" name="config[{$config.name}]" required  lay-verify="required" placeholder="{$config.title}" autocomplete="off" class="layui-input" value="{$config.value}">
          </div>
        </div>
        {/case}
        
        {case value="2"}
        <div class="layui-form-item layui-form-text">
          <label class="layui-form-label">{$config.title}：</label>
          <div class="layui-input-block">
            <textarea name="config[{$config.name}]" placeholder="{$config.title}" class="layui-textarea">{$config.value}</textarea>
          </div>
        </div>
        {/case}
        
        {case value='4'}
        <div class="layui-form-item">
          <label class="layui-form-label">{$config.title}：</label>
          <div class="layui-input-block">
            <select name="config[{$config.name}]">
              <option value="">请选择{$config.title}</option>
              {php}$option = config_parse(3,$config['extra']);{/php}
              {foreach $option as $ok=>$ov} 
              <option value="{$ok}" {if condition="$config['value'] eq $ok"/}selected{/if}>{$ov}</option>
              {/foreach}
            </select>
          </div>
        </div>
        {/case}
        
        {/switch}
        {/volist}
        {/if}

    </div>
    {php}$gkey ++;{/php}
    {/volist}
    <div class="layui-form-item">
          <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal ajax-post-btn" lay-submit lay-filter="sysconf">立即提交</button>
          </div>
        </div>
    
    
    
  </div>
  
</div>
</form>
<script src="__STATIC__/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> 
<script src="__STATIC__/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script> 
<script src="__STATIC__/js/common.js" type="text/javascript" charset="utf-8"></script> 
<script>
		//Demo
		layui.use(['form','element'], function(){
		  var form = layui.form();
		  var element = layui.element();
		  form.render();
		  //监听信息提交
		  form.on('submit(sysconf)', function(data){
		    //layer.msg(JSON.stringify(data.field));
			ajax_post('info_form',false,'','');
		    return false;
		  });
		  
		});
	</script>
</body>
</html>